#include<bits/stdc++.h>
using namespace std;
template<typename T>inline void read(T &x){
    x=0;int f=1;char c=getchar();
    while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
    while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
    x*=f;
}
const int N=1e6+5;
int n,L[N],r[N],R[N];
double h[N],mx,ans,b[N];
int main(){
    freopen("wan.in","r",stdin);
    freopen("wan.out","w",stdout);
    read(n);
    int V=2e8/n;
    for(int i=1;i<=n;++i){
        read(L[i]),read(r[i]),read(R[i]);
        b[i]=(R[i]-r[i])/1.0/L[i];
        mx=0;
        for(int j=i-1;j>=max(1,i-V);--j){
            if(r[i]>=R[j]) mx=max(mx,h[j]+L[j]);
            else if(r[i]<=r[j]&&R[i]<=R[j]) mx=max(mx,h[j]);
            else if(R[i]<=R[j]&&r[i]<=r[j]) mx=max(mx,h[j]+(R[i]-r[j])/1.0/b[j]-L[i]);
            else if(R[i]<=R[j]&&r[i]>r[j]) mx=max(mx,h[j]+(r[i]-r[j])/1.0/b[j]);
            else if(R[i]>=R[j]) mx=max(mx,h[j]+max(0.0,L[j]-(R[j]-r[i])/1.0/b[i]));
        }
        h[i]=mx;
        ans=max(ans,h[i]+L[i]);
    }
    printf("%.6lf\n",ans);
    return 0;
}